#define  _CRT_SECURE_NO_WARNINGS 1
/*
* Name:test_2_7 
* Purpose:Enter a dollar amount,and show how to pay with the smallest number of $20,$10,$5,and$1 bills
*Author:zzr
*/

#include <stdio.h>

int main(void)
{
	int amount;
	printf("Enter a dollar amount:");
	scanf("%d", &amount);

	/*
	printf("\n$20 bills:%d \n", amount / 20);
	int amount1 = amount - 20 * (amount / 20);
	printf("$10 bills:%d \n", amount1 / 10);
	int amount2 = amount1 - 10 * (amount1 / 10);
	printf("$5 bills:%d \n", amount2 / 5);
	int amount3 = amount2 - 5 * (amount2 / 5);
	printf("$1 bills:%d \n", amount3 / 1);
	*/
	int twenty_note = amount / 20;
	int ten_note = (amount - twenty_note * 20) / 10;
	int five_note = (amount - twenty_note * 20 - ten_note * 10) / 5;
	int one_note = (amount - twenty_note * 20 - ten_note * 10 - five_note * 5) / 1;

	printf("$20 bills:%d\n", twenty_note);
	printf("$10 bills:%d\n", ten_note);
	printf("$5 bills:%d\n", five_note);
	printf("$1 bills:%d\n", one_note);

	return 0;
}